<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <meta name="renderer" content="webkit" />
    <meta name="force-rendering" content="webkit" />
    <title>广告列表</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="viewport"
        content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">

    <link rel="stylesheet" href="../css/shop.css">
    <link rel="stylesheet" href="../css/weui.min.css">
    <link rel="stylesheet" href="../css/jquery-weui.min.css">
    <script src="../js/jquery-2.1.4.js"></script>
    <script src="../js/jquery-weui.js"></script>
    <script src="../wxJs/utils/contain.js"></script>
    <script src="../wxJs/utils/storage.js"></script>
    <script type="text/javascript" src="../js/city-picker.js" charset="utf-8"></script>
</head>

<body>
    <div class="header">
        <a class="haader-left" href="javascript:window.history.go(-1)"><i class="iconfont icon-left"></i></a>
        <div class="haader-content">广告列表</div>
        <div class="haader-right">
            <i class="iconfont icon-shaixuan"></i>
            <a href="adv_edit.html"><i class="iconfont icon-add"></i></a>
        </div>
    </div>

    <div id="applyList">

    </div>

    <!--<a class="order-item flex" href="adv_edit.html">
        <div class="image-contain  iconfont icon-guanggaogongguan"></div>
        <div class="flex column ellipsis">
            <div class="name ellipsis">广告标题广告标题广告标题广告标题广告标题广告标题广告标题广告标题广告标题广告标题</div>
            <div class="flex between items">
                <div class="cl-main">10/天</div>
                <div class="cl-main f12">2020-10-10</div>
            </div>

        </div>
    </a>
    <a class="order-item flex" href="javascript:void(0);">
        <div class="image-contain  iconfont icon-guanggaogongguan"></div>
        <div class="flex column ellipsis">
            <div class="name ellipsis">广告标题广告标题广告标题广告标题广告标题广告标题广告标题广告标题广告标题广告标题</div>
            <div class="flex between items">
                <div class="cl-main">10/天</div>
                <div class="cl-main f12">2020-10-10</div>
            </div>
        </div>
    </a>
    <a class="order-item flex" href="adv_edit.html">
        <div class="image-contain  iconfont icon-guanggaogongguan"></div>
        <div class="flex column ellipsis">
            <div class="name ellipsis">广告标题广告标题广告标题广告标题广告标题广告标题广告标题广告标题广告标题广告标题</div>
            <div class="flex between items">
                <div class="cl-main">10/天</div>
                <div class="cl-sub f12">已结束</div>
            </div>

        </div>
    </a>-->
</body>
<script>

    var shopId =ue.getStorage("shopId")
    if (!shopId){
        window.location.href = "../index.html?infrom=1"
    }else {
        selectCarouel()
    }
    $(".icon-shaixuan").select({
        title: "请选择",
        items: ["轮播展示", "列表展示"],
        onClose:function(obj){
           var value = obj.data.values
            if (value =="轮播展示"){
                selectCarouel()
            } else{
                querySeatList()
            }
        },
    });

/*列表展示*/
function querySeatList(){
    $.get(getWeiContextPath()+"/wx/adv/querySeatListByShopId",{shopId:shopId},function (res) {
        var  _applyList=$('#applyList').empty()
        $.each(res,function (i, obj) {
            _applyList.append('<a class="order-item flex" href="javascript:void(0);">\n' +
                '        <div class="image-contain  iconfont icon-guanggaogongguan"></div>\n' +
                '        <div class="flex column ellipsis">\n' +
                '            <div class="name ellipsis">'+obj.advTitle +'</div>\n' +
                '            <div class="flex between items">\n' +
                '                <div class="cl-main">'+obj.seatName+'</div>\n' +
                '                <div class="cl-sub f12">'+obj.startTime.substring(0,10) +"至"+obj.endTime.substring(0,10) +'</div>\n' +
                '            </div>\n' +
                '        </div>\n' +
                '    </a>')
        })
    })
}
/*轮播展示*/
function selectCarouel(){
    $.get(getWeiContextPath()+"/wx/data/querySeatListByShopId",{shopId:shopId},function (res) {
        var  _applyList=$('#applyList').empty()
        $.each(res,function (i, obj) {
            _applyList.append('<a class="order-item flex" href="javascript:void(0);">\n' +
                '        <div class="image-contain  iconfont icon-guanggaogongguan"></div>\n' +
                '        <div class="flex column ellipsis">\n' +
                '            <div class="name ellipsis"></div>\n' +
                '            <div class="flex between items">\n' +
                '                <div class="cl-main">'+obj.seatName+'</div>\n' +
                '                <div class="cl-sub f12">'+obj.startTime.substring(0,10) +"至"+obj.endTime.substring(0,10) +'</div>\n' +
                '            </div>\n' +
                '        </div>\n' +
                '    </a>')
        })
    })
}




</script>

</html>